//
//  lifeDetailViewController.m
//  runingBabyModel
//
//  Created by lanou3g on 15/7/20.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "lifeDetailViewController.h"
#import "HomePageViewController.h"
#import "UIImageView+WebCache.h"
@interface lifeDetailViewController ()

@end

@implementation lifeDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = _categoryDetail;
    self.view.backgroundColor = [UIColor whiteColor];
    [self detailLayout];
}

-(void)detailLayout{
    //获取详情的高度
    CGFloat height = [HomePageViewController stringHeight:_contentDetail];
    UIScrollView *detailScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 667)];
    detailScrollView.contentSize = CGSizeMake(self.view.frame.size.width, 200 + height + 15);
    [self.view addSubview:detailScrollView];
    //创建imageview
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,200 )];
    imageView.backgroundColor = [UIColor blackColor];
    NSURL *url = [NSURL URLWithString:_imageUrlDetail];
    [imageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"imageLoad.png"]];
    NSLog(@"%@",NSHomeDirectory());
    [detailScrollView addSubview:imageView];
    
    //创建label
    UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 160, 355, 35)];
    nameLabel.text = _categoryDetail;
    nameLabel.font = [UIFont systemFontOfSize:25];
    [detailScrollView addSubview:nameLabel];
    
    //创建contentLabel
    UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 205, self.view.frame.size.width - 20, height)];
    contentLabel.text = _contentDetail;
    contentLabel.numberOfLines = 0;
    [detailScrollView addSubview:contentLabel];
    
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
